/* typehints:start */
import { Application } from "../../application";
import { ModalDialogs } from "../utils/modal_dialog";
/* typehints:end */

export class PlatformInterface{
  constructor(app){
    /** @type {Application} */
    this.app = app;
  }

  getKey(){
    abstract;
    return '';
  }

  // 是否有热更新
  getIsLiveUpdate(){
    abstract;
    return false;
  }

  /**
   * 热更新代码
   * @param {Promise.resolve} resolve 
   * @param {ModalDialogs} dialogs 
   */
  liveUpdate(resolve, dialogs){
    abstract;
  }

  /**
   * 打开外部链接
   * @param {*} url 
   */
  openLink(url){
    window.open(url);
  }

  /**
   * 启动应用
   */
  restart(){
    window.location.reload();
  }
}